<template>
  <div>
    <Myheader title="购物车案例" backgroundColor="blue" color="white">
    </Myheader>
    <div class="main">
      <Mygoods :goodobj="obj" v-for="obj in list" :key="obj.id"></Mygoods>
    </div>
    <Myfooter :arr="list"></Myfooter>
  </div>
</template>

<script>
import Myheader from "./components/myheader";
import Myfooter from "./components/myfooter";
import Mygoods from "./components/mygoods";

export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.$axios({
      url: "https://www.escook.cn/api/cart",
    }).then((res) => {
      this.list = res.data.list;
    });
  },
  components: {
    Myheader,
    Myfooter,
    Mygoods,
  },
};
</script>

<style scoped>
.main {
  padding: 45px 0 50px 0;
}
</style>
